package emulator.unittest.hardware.nmos6502.commands;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import emulator.EmulatorException;
import emulator.hardware.HwByte;
import emulator.hardware.nmos6502.Cpu6502;
import emulator.hardware.nmos6502.Flags6502;
import emulator.hardware.nmos6502.commands.NOP;
import emulator.hardware.nmos6502.operands.NoOperand;

public class NOPTest {

	@Test
	public void testExecute() throws EmulatorException {
		Cpu6502 cpu = new Cpu6502();
		HwByte accu = cpu.getAccu();
		HwByte x = cpu.getX();
		HwByte y = cpu.getY();
		Flags6502 flags = cpu.getFlags();
		HwByte sp = cpu.getSP();
		int pc = cpu.getPC();
		NOP nop = new NOP();
		nop.execute(cpu, new NoOperand());
		assertEquals(accu, cpu.getAccu());
		assertEquals(x, cpu.getX());
		assertEquals(y, cpu.getY());
		assertEquals(flags, cpu.getFlags());
		assertEquals(sp, cpu.getSP());
		assertEquals(pc, cpu.getPC());
	}
}
